{layout name="public/layout" /}
{include file='yxnavbar'}


<div class="main">
    {include file='koi_common_nav'}
    <div class="panel panel-info">
        <div class="panel-heading">当前数量： {$page_total}</div>
        <div class="panel-body">
            <div class="form-group clearfix">
                <div class="col-sm-3 col-lg-3 col-md-3 col-xs-6">
                    <button class="btn btn-default" onclick="sendSubMsg(this)"
                            data-themeid="{$themeid}"
                            data-id="{$item['f_id']}"
                            data-edit-url="{php echo createWebUrl('koi', array('op' =>'send_sub'));}"
                    > 发送通知</button>
                </div>
            </div>
        </div>
    </div>

    <input type="hidden" name="current_ac" id="current_ac" value="{$ac}">
    <!--  列表框  -->
    <div class="tab-content">
        <div class="panel panel-default">
            <div class="panel-body table-responsive">
                <table class="table table-hover">
                    <thead class="navbar-inner">
                    <tr>
                        <th style="width: 50px">序号</th>
                        <th style="width: 120px">用户昵称</th>
                        <th style="width: 120px">用户报名信息</th>
                        <th style="width: 100px">用户头像</th>
                        <th style="width: 100px">状态</th>
                        <th style="width: 100px">更新时间</th>
<!--                        <th style="width: 100px">操作</th>-->
                    </tr>
                    </thead>
                    <tbody>
                    {loop $list $item}
                    <tr>
                        <td>{$item['s_id']}</td>
                        <td>{$item['nickname']}</td>
                        <td>{$item['username']}<br/>{$item['mobile']}</td>
                        <td>
                            <a href="{php echo tomedia($item['avatar']);}"  target="_blank" title="查看原图">
                                <img src="{php echo tomedia($item['avatar']);}" style="width: 40px;height: 40px;padding: 1px;">
                            </a>
                        </td>
                        <td>
                            {if $item['status']==1}
                            <span class="label label-warning">未发送订阅消息</span>
                            {else}
                            <span class="label label-success">已发送订阅消息</span>
                            {/if}
                        </td>
                        <td>
                            {$item['updated_at']}
                        </td>
<!--                        <td>-->
<!--                            {if $item['status']==1}-->
<!--                            <a class="btn btn-primary btn-sm" style="width: 35px" onclick="changeOrDelLttInfo(this)"-->
<!--                               data-type="edit"-->
<!--                               data-edit-url="{php echo createWebUrl('koi', array('op' =>'flag_update'));}"-->
<!--                               data-themeid="{$themeid}" data-id="{$item['f_id']}"  title="核销" data-toggle="tooltip" data-placement="top">-->
<!--                                <i class="fa fa-pencil-square-o"> </i>-->
<!--                            </a>-->
<!--                            {/if}-->
<!--                        </td>-->
                    </tr>
                    {/loop}
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
{$pager}
<script type="text/javascript">
    $(document).ready(
        function (){
        }
    );
    function drop_confirm(msg, url){
        if(confirm(msg)){
            window.location = url;
        }
    }
    // 修改、删除
    function sendSubMsg(e) {
        let themeid = e.getAttribute("data-themeid");
        postUrl = e.getAttribute("data-edit-url");
        layer.msg('您确定发送消息提醒吗？',{
            btn:['确定','取消'],
            yes:function (index) {
                $.ajax({
                    url:postUrl,
                    dataType:'json',
                    method:'post',
                    data: {themeid:themeid},
                    success:function (e) {
                        let res = e.message;
                        let code = res.code;
                        let msg = res.msg;
                        if (code!=200){
                            layer.msg(msg);
                        }else{
                            layer.msg(msg);
                            location.reload();
                        }
                    },
                    fail:function (err) {
                        console.log(err)
                    }
                });
            }
        });
    }
</script>
